<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // function fn(a) {
        //     return a
        // }
        // let fn = a => a
        // console.log(fn(1))
        // let fn = a => ({a:'111',b:'122'} )
        // console.log(fn())
        var data = [
            {
                id: 1,
                name: '小明',
                age: 24,
                gender: '男'
            },
            {
                id: 2,
                name: '小芳',
                age: 30,
                gender: '女'
            },
            {
                id: 3,
                name: '小美',
                age: 31,
                gender: '女'
            },
            {
                id: 4,
                name: '小刚',
                age: 21,
                gender: '男'
            },
            {
                id: 5,
                name: '小琪',
                age: 18,
                gender: '女'
            }
        ];

        // let res = data.filter(function(item) {
        //     return item.age > 20
        // })
        // let result = res.filter(function(item) {
        //     return item.gender == "女"
        // })
        // console.log(result)
        // let res = data.filter(item => item.age > 20 && item.gender == '女') 
        let res = data.filter(item => item.age > 20).filter(item => item.gender == '女')

        console.log(res)



    </script>
</body>
</html>